#!/bin/bash

TARGET=$1img

cd ./proxy/

VER=`cat ./ver`

FIRST=`echo $VER | awk 'BEGIN { FS="." }{print $1}'`
SECOND=`echo $VER | awk 'BEGIN { FS="." }{print $2}'`

NEW_VER=$[ $SECOND + 1 ]

Green=$'\e[1;32m'
Normal=$'\e[0m'

echo
echo "update to: $Green$FIRST.$NEW_VER$Normal"
echo "  old ver: $FIRST.$SECOND"

echo $FIRST.$NEW_VER > ./ver

cd ..

rm -rf $TARGET/proxy

cp -r ./proxy/ $TARGET
